﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace doveData
{
    public abstract class BaseObj
    {
        public string name;
        public string id;
    }


    public class Station:BaseObj
    {
        public Dictionary<int, int> LineDict = new Dictionary<int, int>();//线路中对应的编号 key查询所属线路 value查询在线路中的索引

        //测试用


        #region 构造函数

        public Station(string stationId,int lineIndex,int stationIndex,string stationName)
        {
            id = stationId;
            LineDict.Add(lineIndex,stationIndex);
            name = stationName;
            Debug();
        }
        #endregion

        public void Debug()
        {
            string lineInfo="";
            foreach (int key in LineDict.Keys)
            {
                lineInfo += key + 1 + "号线" + LineDict[key] + "站——";
            }
            Console.WriteLine("id:{0},name:{1},Lines:{2}",id,name,lineInfo);
        }

        public override string ToString()
        {
           //Console.WriteLine("{0}号线{1}站",line,number);
            string message="";
            foreach (int key in LineDict.Keys)
            {
                message += key+1 + "号线" + LineDict[key] + "站";
            }
            return message;
            //string message;
            //message = Name + "，序号为" + Id;
            //return message;
            //return base.ToString();
        }
    }

    
}
